﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Common;
using Microsoft.Practices.ObjectBuilder;
using System.Data.Common;
using System.Data;


namespace DataAccess
{
    public class WareHouseData
    {
        public DataTable test()
        {
            //string sqlCommand = "Select count(*) from Warehouse";
            string sqlCommand2 = "Select * from Course";
            Database db = DatabaseFactory.CreateDatabase();
            //DbCommand dbCommand = db.GetSqlStringCommand(sqlCommand);
            DbCommand dbCommand2 = db.GetSqlStringCommand(sqlCommand2);
            //int count = (int)db.ExecuteScalar(dbCommand);
            DataSet dataSet = db.ExecuteDataSet(dbCommand2);
            DataTable dataTable = dataSet.Tables[0];
            return dataTable;
        }
    }
}
